# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BigQueryReservation.V1.Model.Assignment do
  @moduledoc """
  An assignment allows a project to submit jobs of a certain type using slots from the specified reservation.

  ## Attributes

  *   `assignee` (*type:* `String.t`, *default:* `nil`) - The resource which will use the reservation. E.g. `projects/myproject`, `folders/123`, or `organizations/456`.
  *   `enableGeminiInBigquery` (*type:* `boolean()`, *default:* `nil`) - Optional. This field controls if "Gemini in BigQuery" (https://cloud.google.com/gemini/docs/bigquery/overview) features should be enabled for this reservation assignment, which is not on by default. "Gemini in BigQuery" has a distinct compliance posture from BigQuery. If this field is set to true, the assignment job type is QUERY, and the parent reservation edition is ENTERPRISE_PLUS, then the assignment will give the grantee project/organization access to "Gemini in BigQuery" features.
  *   `jobType` (*type:* `String.t`, *default:* `nil`) - Which type of jobs will use the reservation.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Name of the resource. E.g.: `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. The assignment_id must only contain lower case alphanumeric characters or dashes and the max length is 64 characters.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. State of the assignment.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :assignee => String.t() | nil,
          :enableGeminiInBigquery => boolean() | nil,
          :jobType => String.t() | nil,
          :name => String.t() | nil,
          :state => String.t() | nil
        }

  field(:assignee)
  field(:enableGeminiInBigquery)
  field(:jobType)
  field(:name)
  field(:state)
end

defimpl Poison.Decoder, for: GoogleApi.BigQueryReservation.V1.Model.Assignment do
  def decode(value, options) do
    GoogleApi.BigQueryReservation.V1.Model.Assignment.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BigQueryReservation.V1.Model.Assignment do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
